package com.jf.mall.domain;

import java.math.BigDecimal;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-10-10
 * Time:18:57
 */
public class OrderItem {
    //1.id
    //2.订单id
    //3.家具名
    //4.单价
    //5.数量
    //6.总金额
    private int id;
    private String orderId;
    private String name;
    private BigDecimal unitPrice;
    private Integer count;
    private BigDecimal totalPrice;
    public OrderItem(){
    }

    public OrderItem(String orderId, Commodity commodity){
        this.orderId = orderId;
        this.name = commodity.getName();
        this.unitPrice = commodity.getUnitPrice();
        this.count = commodity.getCount();
        this.totalPrice = commodity.getTotalPrice();
    }

    public OrderItem(String orderId, String name, BigDecimal unitPrice, Integer count, BigDecimal totalPrice) {
        this.orderId = orderId;
        this.name = name;
        this.unitPrice = unitPrice;
        this.count = count;
        this.totalPrice = totalPrice;
    }

    public String getOrderId() {
        return orderId;
    }

    public String getName() {
        return name;
    }

    public BigDecimal getUnitPrice() {
        return unitPrice;
    }

    public Integer getCount() {
        return count;
    }

    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setUnitPrice(BigDecimal unitPrice) {
        this.unitPrice = unitPrice;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }
}
